<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
		var Tshrit = 245;
		var TshritCount = 2;
		var Tshose = 570;
		var TshoseCount = 10;
		var Tpai = 320;
		var TpaiCount = 1;
		var allprice = Tshrit*TshritCount+Tshose*TshoseCount+Tpai*TpaiCount;
		var discount = 0.8;
		var trueprice = 5300;
		var zhaoling = trueprice - allprice*discount ;
			document.write("<table style='width: 600px;' align='center'>");
			document.write("<tr>");
			document.write("<td colspan='4' align='center'>*******消费单*******</td>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>购买物品</td>");
			document.write("<td>单价</td>");
			document.write("<td>数量</td>");
			document.write("<td>金额</td>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>T恤</td>");
			document.write("<td>&yen;"+Tshrit+"</td>");
			document.write("<td>"+TshritCount+"</td>");
			document.write("<td>&yen;"+Tshrit*TshritCount+"</td>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>网球鞋</td>");
			document.write("<td>&yen;"+Tshose+"</td>");
			document.write("<td>"+TshoseCount+"</td>");
			document.write("<td>&yen;"+Tshose*TshoseCount+"</td>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>网球拍</td>");
			document.write("<td>&yen;"+Tpai+"</td>");
			document.write("<td>"+TpaiCount+"</td>");
			document.write("<td>&yen;"+Tpai*TpaiCount+"</td>");
			document.write("</tr>");
			document.write("<tr style='height: 40px;'>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>折扣:</td>");
			document.write("<td>8折</td>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>消费总金额:</td>");
			document.write("<td>&yen;"+allprice*discount+"</td>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>实际缴费:</td>");
			document.write("<td>&yen;"+trueprice+"</td>");
			document.write("</tr>");
			document.write("</tr>");
			document.write("<tr>");
			document.write("<td>找零:</td>");
			document.write("<td>&yen;"+zhaoling+"</td>");
			document.write("</tr>");
		    document.write("</table>");
		</script>
	</body>
</html>
